From d13f0d00902e0a9c1ee2fb7650b0a7195fd76e4f Mon Sep 17 00:00:00 2001 From: robertl Date: Tue, 30 Sep 2003 04:54:08 +0000 Subject: [PATCH] Add doc for Mapsource format. From Mark Bradley. --- intdoc/MPSformat | 344 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 344 insertions(+) create mode 100644 intdoc/MPSformat diff --git a/intdoc/MPSformat b/intdoc/MPSformat new file mode 100644 index 000000000..575eeac68 --- /dev/null +++ b/intdoc/MPSformat @@ -0,0 +1,344 @@ +// An EBNF+ format. + +// "xxx" is the literal three characters x, x and x +// 0xA8 means a byte of hexadecimal value A8 +// ::= 0x00 +// FunctionName() means the result of FunctionName when executed on parameter +// FunctionName ::= defines the result format in a text description +// [] means is optional +// | means either or +// { } is grouping of two or more entities together; mainly for use with the | or operator +// This is a comment +// Entity names might be long winded but are intended to convey some meaning without explicit/additional comments + +// Version history +// V2.2 - 2003/09/27 23:33 BST (GMT+1) mrcb.mps.fmt@osps.net +// Corrected typoes +// Corrected NULL terminated string length counts for records with strings +// V2.1 - 2003/09/12 18:23 BST (GMT+1) mrcb.mps.fmt@osps.net +// Changed some of the expressions covering the sections so that the LengthOf(x) was a less ambiguous x +// Corrected some typoes +// Added definitions of MapSource V5.0 (this creates data files of format 1.05, apparently) +// +// V2.0 - 2003/07/15 21:34 BST (GMT+1) mrcb.mps.fmt@osps.net +// Complete definitions as far as possible (in my ability, anyway) for V3.02 formats. +// Some typoes cleaned up. +// Replaced "unknown" by "UNKNOWN" in entity names where the meaning is not known to this author +// (as opposed to, for example, where the meaning is known but the value happens to be "unknown", +// as in the colour unknown). +// Added definitions for V5.03beta of MapSource - no seeming significant changes from v4 - woopee. +// +// V1.0 - 2003/06/30 21:00 BST mrcb.mps.fmt@osps.net +// First "release". Coverage for version 4.xx (to 4.13) is good although some unknowns still +// Coverage for V3.x is less good since it seems a little needless to document a format no longer +// in use, so why start to? Good question. Perhaps I'll finish it off when my MapSource 3 machine +// is fixed. + + +// Start of MapSource definition ================================================== + ::=
[] [] [] [] + +
::= + + ::= "MsRc" + + ::= + + ::= "d" + + ::= LengthOf() + + ::= "D" + + ::= | | | + | + + ::= "d" + ::= "g" + ::= "h" + ::= "i" + ::= "i" + + ::= LengthOf() + + ::= "A" + + ::= | | | + | + +// Perhaps this is software build number + ::= 0x2E 0x01 + ::= 0x96 0x01 + ::= 0x9D 0x01 + ::= 0xF4 0x01 + ::= 0xF4 0x01 + +// SQA might be Software Quality Assurance; buell appears in the beta, so is presumably the programmer's id + ::= "SQA" | "buell" + + ::= | | | + | + + ::= "Oct 20 1999" "12:50:03" + ::= "Oct 22 2001" "15:45:05" + ::= "Mar 7 2003" "15:12:28" + ::= "Jun 27 2003" "10:12:10" + ::= "Jul 3 2003" "08:35:39" + + ::= LengthOf() + + ::= "V" ASCII-Map-Set-Name-can-be-blank + + ::= | + ::= 0x00 + ::= 0x01 + +// ............................ + ::= + + ::= LengthOf() [] + + ::= | | + + ::= "W" + + + + + ::= x-character-short-name + + ::= Long(class) +// Class classification - cf D154_Wpt_Type +// 0 = user waypoint, editable +// 1 = Airport, not user editable +// 2 = Aviation Intersection, not user editable +// 3 = NDB (whatever that is), not user editable +// 4 = VOR, not user editable +// 5 = Runway Threshold, not user editable +// 6 = Airport Intersection, not user editable +// 7 = Airport NDM, not user editable +// 8 = Map Point, not user editable +// 9 = Map Area, not user editable +// A = Map Intersection, not user editable +// B = Map Address, not user editable +// C = Map Line, not user editable + +// Valid for waypoint class types 1 to 8 + ::= country-string + +// Perhaps some waypoint subclass definition? +// The following almost certainly contains - this is the case for the V4 formatted file +// Vwip - added 0x00 at the end of this + ::= 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0x00 + + ::= ASCII-Character-string + + ::= + + ::= | | + + ::= Long(0x00) + ::= Long(0x01) + ::= Long(0x02) + + ::= + + ::= Long() + +// Next three only valid for waypoint classes 1 to 8 + ::= city-string + ::= USA-state-for-waypoint-city-string + ::= facility-string + + ::= + + ::= 2-bytes-unknown + + ::= "W" + + + + +// The first four bytes are probably a Long() +// The first four bytes of the sequence of twelve 0xFFs are either two Word() values or one Long() one +// The two zeros between the FFs are a word value used (at least) when the waypoint is created as part of a route +// The four 0xFFs or four 0x00s are alternatives; 0xFFs if the waypoint is created from scratch in this version of MapSource; +// 0x00s if the waypoint was actually created in V3 of MapSource and the file is saved in this version + ::= {0x00 0x00 0x00 0x00 0xFF {0xFF 0xFF 0xFF 0xFF} | {0x00 0x00 0x00 0x00} 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF + 0x00 0x00 0xFF 0xFF 0xFF 0xFF} + + +// Perhaps the 2 bytes of plus Field-defined-flag plus a Long value + ::= 7-bytes-unknown + + ::= + +// ............................ + ::= + + ::= LengthOf() [] + + ::= | | + + ::= "R" ASCII-Route-Name-string + Long(Number-of-Waypoints-in-Route) + + ::= "R" ASCII-Route-Name-string + Long(Number-of-Waypoints-in-Route) + + ::= + + ::= | + ::= Word(0x00) + ::= Word(0x01) + +// Max values taken from all waypoints in the route to form a virtual "upper right" point + ::= + +// Part of the route bounding a 3D co-ordinate + ::= + +// Min values taken from all waypoints in the route to form a virtual "lower left" point + ::= + +// Part of the route bounding a 3D co-ordinate + ::= + + ::= Long(0x00) 0x01 + + ::= [] + + ::= + + ::= ASCII-name + +// The first zero seems to be a string terminator + ::= 0x00 0x03 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 + 0x00 0x00 + + ::= Long(0x00) 0x01 + + ::= [] + + ::= + +// The first zero seems to be a string terminator + ::= 0x00 0x03 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 + 0x00 0x00 0x00 + + ::= Long(0x02) + + + ::= + + ::= + +// Virtual "Upper right top" co-ordinate + ::= + +// Virtual "lower left bottom" co-ordinate + ::= + + ::= + +// ............................ + ::= + + ::= LengthOf() [] + + ::= | | + + ::= "T" ASCII-Tracklog-Name-string + Long(Number-of-datapoints-in-tracklog) + + ::= + + ::= + + ::= | + ::= 0x01 + ::= 0x00 + + ::= + + ::= [] [] + + ::== + +// ............................ + ::= + + ::= LengthOf() [] + + ::= | | + +// Map segments are portions of the overall map +// What is stored in the MPS file is not the map detail but references to the detail +// Area name refers to an area larger than the segment, perhaps by way of locating the segment within the World + ::= "L" Long(Map-CD-ID) Long(Segment-ID) ASCII-CD-Name ASCII-Segment-Name ASCII-Area-Name Long(0x00) + + ::= + + ::= + +// Common definitions -------------------------------------------------------------- + + ::= | | | colour dark green> | | | + | | | | | + | | | | + ::= Long(0x00) + ::= Long(0x01) + ::= Long(0x02) + ::= Long(0x03) + ::= Long(0x04) + ::= Long(0x05) + ::= Long(0x06) + ::= Long(0x07) + ::= Long(0x08) + ::= Long(0x09) + ::= Long(0x0A) + ::= Long(0x0B) + ::= Long(0x0C) + ::= Long(0x0D) + ::= Long(0x0E) + ::= Long(0x0F) + ::= Long(0x10) + + ::= + + ::= Double(Value in metres) + + ::= + + ::= Long(date-time-seconds-since-00:00:00-01/01/1970) + + ::= + +// Depth is not negative altitude - GPS not being overly useful on a submarine - but the "thickness" of a GPS point (e.g. airspace) +// Assumed to be calculated below the GPS datapoint height. If so, then the object being referenced extends from +// (Altitude - depth) to (Altitude) upwards + ::= Double(value in metres) + + ::= + + ::= Double(Value in metres) + + ::= | + ::= 0x01 + ::= 0x00 + +// Check out the values in the Garmin Protocol description document and elsewhere on the web + ::= Too-many-to-list-here-! + + ::= Long(latitude * 2^31 / 180) + ::= Long(longitude * 2^31 / 180) + +// Start of function definitions --------------------------------------------------- +Word ::= 2 bytes, little endian +Long ::= 4 bytes, little endian +Double ::= 8 byte, little endian, IEEE format +LengthOf ::= 4 bytes, little endian - zero value means "1 element long" +// End of function definitions + +// End of MapSource defintion + -- 2.30.2